﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;

namespace WeeGODAL
{
    public class DLMovComment
    {
        
        /// <summary>
        /// 作者：张晨
        /// 状态：Finished
        /// 作用：显示评论
        /// 被MovComment类里的ShowComment(string p_MovID)调用
        /// </summary>
        /// <param name="p_MovID"></param>
        /// <returns></returns>
        public IQueryable<dynamic> ShowComment(int p_MovID)
        {
            MovieEntities context = new MovieEntities();
            var data = from p in context.tbMovComment
                       where p.MovID == p_MovID
                       select new
                       {
                           p.MovComment
                       };
            return data;
        }

        /// <summary>
        /// 作者：张晨
        /// 状态：Finished
        /// 被MovComment类里的RelyComment(int p_UserID, int p_CommentID)函数调用
        /// </summary>
        /// <param name="p_UserID"></param>
        /// <param name="p_CommentID"></param>
        /// <returns></returns>
        public IQueryable<dynamic> RelyComment(int p_UserID, int p_CommentID)
        {
            MovieEntities context = new MovieEntities();
            var data = from p in context.tbMovComment
                       where p.UserID == p_UserID && p.MovComID == p_CommentID
                       select new
                       {
                           p.MovComment
                       };
            return data;
        }
    }
}
